package com.wt;

import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.*;

/**
 * Hello world!
 *
 */
@SpringBootApplication
public class App 
{
    public static void main( String[] args )
    {
        int arr[] = {1,2,3,4,5,6,8,7,9,5,4,2,3,4,1,4,24,16,35,1,6,5,4,2,3,5};
        Set set = new HashSet<>();
        Map map = new HashMap();
        Stack stack = new Stack();
        Set set1 = new TreeSet();
        List<Integer> list = new ArrayList();
        for(int j=1; j<arr.length;j++){

                int i = (int)(Math.random()*arr.length);
                System.out.println("随机值:"+arr[i]);
                set.add(arr[i]);
                map.put(arr[i],"");
                stack.add(arr[i]);
                list.add(arr[i]);
            for(int a = 0; a < list.size(); a++)
                for(int b = a + 1; b < list.size(); b++){
                    if(list.get(a).equals(list.get(b)))
                        list.remove(b);
                }
            if(list.size() >= 7){
                break;
            }
        }
        System.out.println("set："+set);
        System.out.println("map:"+map.keySet());
        System.out.println("stack:"+stack);
        System.out.println("list:"+list);
    }
}
